<button type="button" class="btn btn-prusia dropdown-toggle" data-toggle="dropdown">
  <% if article.category_id.blank? %>
      <span>类目</span>
  <% else %>
      <%= article.category.name %>
  <% end %>
  <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" data-articleid="<%= article.id %>">
  <% categories.each do |category| %>
      <% if article.category or category.id != article.category.try(:id) %>
          <li><%= link_to category.name, '#', data: {categoryid: category.id} %></li>
      <% end %>
  <% end %>
</ul>